package com.enjoyiot.module.system.dal.mysql.shipin;


import com.enjoyiot.framework.common.pojo.PageResult;
import com.enjoyiot.framework.mybatis.core.mapper.BaseMapperX;
import com.enjoyiot.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.enjoyiot.module.system.controller.admin.shipin.vo.SHPPageReqVO;
import com.enjoyiot.module.system.dal.dataobject.shipin.SHPDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 视频监控 Mapper
 *
 * @author system
 */
@Mapper
public interface SHPMapper extends BaseMapperX<SHPDO> {

    default PageResult<SHPDO> selectPage(SHPPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<SHPDO>()
                .eqIfPresent(SHPDO::getSpAddress, reqVO.getSpAddress())
                .eqIfPresent(SHPDO::getSpNumber, reqVO.getSpNumber())
                .betweenIfPresent(SHPDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(SHPDO::getId));
    }

}